package com.kewu.system.configuration;

import com.kewu.system.properties.FileProperties;
import io.minio.MinioClient;
import lombok.extern.slf4j.Slf4j;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import javax.annotation.Resource;

@Configuration
@Slf4j
public class MinioConfiguration {
    @Resource
    FileProperties fileProperties;

    @Bean
    public MinioClient minioClient(){
        return MinioClient.builder()
                .endpoint(fileProperties.getMinioEndpoint())
                .credentials(fileProperties.getMinioAk(), fileProperties.getMinioSk())
                .build();
    }
}
